Skip to content

Conversation

@hanna-skryl
Copy link
Collaborator

@hanna-skryl hanna-skryl commented Dec 29, 2025

Closes #1135

  • Add setupScript option for testing login-protected pages
  • Refactor browser management from standalone functions to AxeRunner class for cleaner lifecycle handling
  • Update Zod to v4.2.1 across all packages. This was required because Zod v4.1.5 fixed the z.function() type inference, which is now used for validating the setup function signature.
  • Refactor docsUrlSchema for Zod v4 compatibility
  • Test with a real Angular application behind username/password authentication

@hanna-skryl hanna-skryl self-assigned this Dec 29, 2025
@github-actions github-actions bot added 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🧩 models 🛠️ tooling 🧩 axe-plugin labels Dec 29, 2025
@nx-cloud
Copy link

nx-cloud bot commented Dec 29, 2025

View your CI Pipeline Execution ↗ for commit 7639b33

Command Status Duration Result
nx run ci:code-pushup -- merge-diffs --files=/h... ✅ Succeeded 5s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 1m 26s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 12m 17s View ↗
nx run-many -t unit-test,int-test ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-14 19:15:23 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 29, 2025

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1198

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1198

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1198

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1198

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1198

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1198

@code-pushup/axe-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/axe-plugin@1198

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1198

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1198

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1198

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1198

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1198

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1198

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1198

commit: 7639b33

@github-actions
Copy link
Contributor

github-actions bot commented Dec 29, 2025

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 731580a with previous commit c66c042.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Documentation 🔴 35 🔴 39 ↑ +3.8
Performance 🔴 36 🔴 34 ↓ −2.1
Code coverage 🟢 93 🟢 93 ↓ −0.1
Bug prevention 🟡 75 🟡 75 ↓ −0.1
Axe Accessibility 🟡 88 🟡 88 ↓ −0.1
Code style 🟢 99 🟢 99
Security 🟡 51 🟡 51
Updates 🟡 78 🟡 78
Type Safety 🟡 67 🟡 67
Miscellaneous 🟡 67 🟡 67
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟢 92 🟢 92
👍 1 group improved, 👎 2 groups regressed, 👍 6 audits improved, 👎 7 audits regressed, 13 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JSDocs coverage Documentation coverage 🔴 35 🔴 39 ↑ +3.8
Lighthouse Performance 🔴 36 🔴 34 ↓ −2.1
Code coverage Code coverage metrics 🟢 93 🟢 93 ↓ −0.1

31 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟥 Root document took 610 ms 🟩 Root document took 550 ms ↓ −10.6 %
JSDocs coverage Methods coverage 🟥 13 undocumented methods 🟨 13 undocumented methods  +0 %
JSDocs coverage Classes coverage 🟥 7 undocumented classes 🟥 7 undocumented classes  +0 %
Lighthouse First Contentful Paint 🟥 3.1 s 🟥 3.3 s ↑ +7 %
Lighthouse Speed Index 🟥 6.3 s 🟥 6.6 s ↑ +5 %
Lighthouse Total Blocking Time 🟥 2,250 ms 🟥 2,850 ms ↑ +27.1 %
JSDocs coverage Variables coverage 🟥 275 undocumented variables 🟥 268 undocumented variables ↓ −2.5 %
Lighthouse Time to Interactive 🟥 13.3 s 🟥 13.9 s ↑ +4.9 %
JSDocs coverage Functions coverage 🟥 591 undocumented functions 🟥 577 undocumented functions ↓ −2.4 %
Code coverage Line coverage 🟩 92.8 % 🟩 92.6 % ↓ −0.2 %
JSDocs coverage Types coverage 🟥 265 undocumented types 🟥 266 undocumented types ↑ +0.4 %
Code coverage Branch coverage 🟨 89.1 % 🟨 89.1 % ↓ −0.1 %
Code coverage Function coverage 🟩 94.3 % 🟩 94.3 % ↑ +0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,107 KiB 🟩 Total size was 2,113 KiB ↑ +0.3 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +4.9 %
Lighthouse JavaScript execution time 🟥 4.7 s 🟥 5.3 s ↑ +13.3 %
Lighthouse Largest Contentful Paint 🟥 11.9 s 🟥 12.4 s ↑ +4.7 %
Lighthouse Max Potential First Input Delay 🟥 1,070 ms 🟥 1,430 ms ↑ +34.2 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↑ +0.1 %
Lighthouse Server Backend Latencies 🟩 1,200 ms 🟩 1,450 ms ↑ +20.4 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 99 KiB 🟥 Potential savings of 80 KiB ↓ −36.2 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 95 KiB 🟥 Potential savings of 95 KiB ↑ +27.7 %
Lighthouse Network Round Trip Times 🟩 10 ms 🟩 70 ms ↑ +709.1 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 223 KiB 🟥 Potential savings of 223 KiB ↓ −2.8 %
JSDocs coverage Properties coverage 🟥 23 undocumented properties 🟥 26 undocumented properties ↑ +13 %
Lighthouse Minimizes main-thread work 🟥 11.3 s 🟥 11.3 s ↓ −0.1 %

653 other audits are unchanged.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 29, 2025

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 731580a with previous commit c66c042.

💼 Project plugin-axe

🤨 Code PushUp report has both improvements and regressions.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Documentation 🟡 68 🟡 70 ↑ +2.3
Code coverage 🟢 94 🟢 94 ↓ −0.4

4 other categories are unchanged.

👍 1 group improved, 👎 1 group regressed, 👍 2 audits improved, 👎 3 audits regressed, 1 audit changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JSDocs coverage Documentation coverage 🟡 68 🟡 70 ↑ +2.3
Code coverage Code coverage metrics 🟢 94 🟢 94 ↓ −0.4

13 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
JSDocs coverage Properties coverage 🟩 0 undocumented properties 🟥 3 undocumented properties ↑ +∞ %
JSDocs coverage Functions coverage 🟥 24 undocumented functions 🟨 10 undocumented functions ↓ −58.3 %
JSDocs coverage Variables coverage 🟥 19 undocumented variables 🟥 12 undocumented variables ↓ −36.8 %
Code coverage Line coverage 🟨 72.2 % 🟨 70.5 % ↓ −2.2 %
Code coverage Branch coverage 🟩 90.1 % 🟨 89.2 % ↓ −1 %
JSDocs coverage Types coverage 🟥 8 undocumented types 🟥 9 undocumented types ↑ +12.5 %

437 other audits are unchanged.

💼 Project create-cli

😟 Code PushUp report has regressed.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage 🟢 96 🟢 96 ↓ −0.2

5 other categories are unchanged.

👎 1 group regressed, 👎 1 audit regressed

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage Code coverage metrics 🟢 96 🟢 96 ↓ −0.2

14 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Code coverage Branch coverage 🟨 88.2 % 🟨 87.5 % ↓ −0.8 %

443 other audits are unchanged.

💼 Project models

😟 Code PushUp report has regressed.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage 🟢 94 🟢 94 ↓ −0.1

3 other categories are unchanged.

👎 1 group regressed, 👎 1 audit regressed, 1 audit changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage Code coverage metrics 🟢 94 🟢 94 ↓ −0.1

11 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Code coverage Branch coverage 🟩 94.2 % 🟩 94.1 % ↓ −0.1 %
Code coverage Line coverage 🟩 99.4 % 🟩 99.4 % ↓ −0.1 %

435 other audits are unchanged.


11 other projects are unchanged.

@hanna-skryl hanna-skryl marked this pull request as ready for review December 30, 2025 00:04
Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added suggestion to reduce lines in tests.

Copy link
Collaborator

@matejchalk matejchalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is amazing work! 😍 The implementation is nice and clean, and the documentation should be fairly easy to use. I'm looking forward to trying it out! 🚀

Comment on lines 43 to 46
const module: unknown = await import(absolutePath);
const validModule = await validateAsync(setupScriptModuleSchema, module, {
filePath: absolutePath,
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to log the setup script import. Since it's user-specified, there's a good chance of something going wrong (e.g., provides .ts file, invalid export). Grouping the dynamic import and validation in a logger task would help to provide more context.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pointer! Wrapped it in logger.task().

path.join(fixturesDir, 'valid-setup.ts'),
);

expect(typeof setupFn).toBe('function');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vitest has a dedicated toBeTypeOf matcher that wraps typeof.

Suggested change
expect(typeof setupFn).toBe('function');
expect(setupFn).toBeTypeOf('function');

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used toBeFunction() from jest-extended instead - it seems more semantic.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm anticipating that the setupScript option will be used very often, so it may be worth investing time into adding an E2E test scenario for it. 🤔 It doesn't have to be part of this PR, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, will add an E2E test for the setupScript option in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Axe Plugin - Authentication Support

4 participants